package com.zx.cloud.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;

import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author Alex
 */

@ToString
@EqualsAndHashCode
@RefreshScope
@ConfigurationProperties(prefix = ManualExceptionProperties.PREFIX)
public class ManualExceptionProperties {
	
    public static final String PREFIX = "microservice.exception";

    /**
     * 是否启用随机异常
     */
    private boolean enabled;

    /**
     * 当对此数取余为0就会抛出异常
     */
    private int factor;

	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public int getFactor() {
		return factor;
	}

	public void setFactor(int factor) {
		this.factor = factor;
	}

}
